/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.easoft.code.pos.ui.controllers.impl;

import com.easoft.code.pos.data.pojos.DocumentoOper;
import com.easoft.code.pos.ui.beans.FormInventarioMov;
import com.easoft.code.pos.ui.bind.UIBindManager;
import com.easoft.code.pos.ui.controllers.DataEntryController;
import java.awt.BorderLayout;
import java.util.List;

/**
 *
 * @author Eliu
 */
public class InventoryMovsControllerImpl extends DataEntryController<DocumentoOper> {

    private FormInventarioMov formDataEntry;

    public InventoryMovsControllerImpl(List<String> tableColumnNames, List<String> realTableColumnNames, Class<DocumentoOper> dataType) {
        super(tableColumnNames, realTableColumnNames, dataType);
    }

    @Override
    public void generateBlankForm() {
        setSelRow(new DocumentoOper());
        formDataEntry = new FormInventarioMov(this);
        getFormContainer().removeAll();
        getFormContainer().setLayout(new BorderLayout());
        getFormContainer().add(formDataEntry, BorderLayout.CENTER);
        formDataEntry.loadData(getSelRow(), true);
        formDataEntry.revalidate();
        getFormContainer().revalidate();

        UIBindManager.remove(this.getClass().getSimpleName());

        UIBindManager.masiveBindObject2Input(this.getClass().getSimpleName());

    }

    @Override
    public void generateFilledForm() {
        getFormContainer().removeAll();
        getFormContainer().setLayout(new BorderLayout());

        formDataEntry = new FormInventarioMov(this);
        getFormContainer().add(formDataEntry, BorderLayout.CENTER);

        formDataEntry.loadData(getSelRow(), true);
        formDataEntry.revalidate();
        getFormContainer().revalidate();
        UIBindManager.remove(this.getClass().getSimpleName());

        UIBindManager.masiveBindObject2Input(this.getClass().getSimpleName());

    }

}
